<?php
/**
 * Created by PhpStorm.
 * User: wupicheng
 * Date: 2019/2/9
 * Time: 12:22
 */

namespace app\controller;

use biny\lib\TXLogger;
use biny\lib\TXLanguage;
use TXApp;

class menuAction extends baseAction
{
    //    // 权限配置
//    protected function privilege()
//    {
//        return array(
//            'login_required' => array(
//                'actions' => '*', //绑定action
//            ),
//        );
//    }

    public function action_demo3()
    {
        $lang = $this->get('lang');
        $lang && TXLanguage::setLanguage($lang, \TXConst::month);
        TXLogger::info('you can print some information in console like time: '.date('Y-m-d H:i:s'), 'info');
        $view = $this->display('demo/demo', ['lan'=>TXLanguage::getLanguage('cn')]);
        $view->title = "Biny Framework Wiki";
        return $view;
    }
    public function action_demo1()
    {
        $params = $this->param;
        var_dump($params);
        $data = $this->menuDAO->query2("select * from sp.sp_left_menu");
        //$data = $this->menuDAO->query();
        //返回 json {"flag": true, "ret": {"result": 1}}
        return $this->correct($data);

        //返回 json {"flag": false, "error": {"result": 1}}
        //return $this->error($ret);
    }

}